package com.zhupanlin.order.common;

import lombok.Data;

/**
 * 描述信息：
 *
 * @author zhupanlin
 * @version 1.0
 * @date 2025/1/24 15:03
 */
@Data
public class Result {
    
    private Integer code;
    private String message;
    private Object data;
    
    public static Result success() {
        Result result = new Result();
        result.setCode(200);
        return result;
    }
    
    public static Result success(String msg, Object data) {
        Result result = new Result();
        result.setCode(200);
        result.setMessage(msg);
        result.setData(data);
        return result;
    }
    
    public static Result error() {
        Result result = new Result();
        result.setCode(500);
        return result;
    }
    
    public static Result error(Integer code, String message) {
        Result result = new Result();
        result.setCode(code);
        result.setMessage(message);
        return result;
    }
}